/*
 * query.cpp
 *
 *  Created on: 08/12/2008
 *      Author: desadoc
 */

#include "query.h"

query::query(int num){

	//questao = new QGroupBox(scrollAreaWidgetContents);
	setObjectName(QString::fromUtf8("questao"));
	setGeometry(QRect(0, 0, 761, 80));
	setMinimumSize(QSize(761, 80));
	setMaximumSize(QSize(761, 80));
	setAlignment(Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop);

	button = new QCheckBox(this);
	button->setObjectName(QString::fromUtf8("radioButton"));
	button->setGeometry(10, 40, 40, 20);

	lineVariavel = new QLineEdit(this);
	lineVariavel->setObjectName(QString::fromUtf8("lineVariavel"));
	lineVariavel->setGeometry(QRect(340, 40, 101, 20));

	linePergunta = new QLineEdit(this);
	linePergunta->setObjectName(QString::fromUtf8("linePergunta"));
	linePergunta->setGeometry(QRect(25, 40, 321, 20));

	groupDominio = new QGroupBox(this);
	groupDominio->setObjectName(QString::fromUtf8("groupDominio"));
	groupDominio->setGeometry(QRect(530, 20, 221, 51));

	comboDominio1 = new QComboBox(groupDominio);
	comboDominio1->setObjectName(QString::fromUtf8("comboDominio1"));
	comboDominio1->setGeometry(QRect(10, 20, 41, 22));

	spinValor1 = new QSpinBox(groupDominio);
	spinValor1->setObjectName(QString::fromUtf8("spinValor1"));
	spinValor1->setGeometry(QRect(50, 20, 42, 22));

	comboVar = new QComboBox(groupDominio);
	comboVar->setObjectName(QString::fromUtf8("comboVar"));
	comboVar->setGeometry(QRect(90, 20, 41, 22));

	comboDominio2 = new QComboBox(groupDominio);
	comboDominio2->setObjectName(QString::fromUtf8("comboDominio2"));
	comboDominio2->setGeometry(QRect(130, 20, 41, 22));

	spinValor2 = new QSpinBox(groupDominio);
	spinValor2->setObjectName(QString::fromUtf8("spinValor2"));
	spinValor2->setGeometry(QRect(170, 20, 42, 22));

	tipoVar = new QComboBox(this);
	tipoVar->setObjectName(QString::fromUtf8("tipoVar"));
	tipoVar->setGeometry(QRect(450, 40, 71, 22));

	labelTipo = new QLabel(this);
	labelTipo->setObjectName(QString::fromUtf8("labelTipo"));
	labelTipo->setGeometry(QRect(450, 20, 46, 14));

	labelVariavel = new QLabel(this);
	labelVariavel->setObjectName(QString::fromUtf8("labelVariavel"));
	labelVariavel->setGeometry(QRect(340, 20, 81, 20));

	labelPergunta = new QLabel(this);
	labelPergunta->setObjectName(QString::fromUtf8("labelPergunta"));
	labelPergunta->setGeometry(QRect(25, 20, 46, 14));

	//QMetaObject::connectSlotsByName(this);

// ------------------------------------------------


	this->setWindowTitle(QApplication::translate("questao", "GroupBox", 0, QApplication::UnicodeUTF8));
	this->setTitle(QApplication::translate("questao", tr("Quest\303\203o %1").arg(num).toStdString().c_str(), 0, QApplication::UnicodeUTF8));

	labelPergunta->setText(QApplication::translate("questao", "Pergunta", 0, QApplication::UnicodeUTF8));
	linePergunta->setText(QApplication::translate("questao", "Digite sua pergunta aqui", 0, QApplication::UnicodeUTF8));

	labelVariavel->setText(QApplication::translate("questao", "Nome da Vari\303\241vel", 0, QApplication::UnicodeUTF8));
	lineVariavel->setText(QString());

	labelTipo->setText(QApplication::translate("questao", "Tipo", 0, QApplication::UnicodeUTF8));

	tipoVar->clear();
		tipoVar->insertItems(0, QStringList()
	<< QApplication::translate("questao", "Valor Inteiro", 0, QApplication::UnicodeUTF8)
	<< QApplication::translate("questao", "Valor Real", 0, QApplication::UnicodeUTF8)
	<< QApplication::translate("questao", "Palavra", 0, QApplication::UnicodeUTF8)
	<< QApplication::translate("questao", "Booleano", 0, QApplication::UnicodeUTF8)
	);

	groupDominio->setTitle(QApplication::translate("questao", "Dom\303\255nio da vari\303\241vel", 0, QApplication::UnicodeUTF8));

	comboDominio1->clear();
	comboDominio1->insertItems(0, QStringList()
	<< QApplication::translate("questao", ">=", 0, QApplication::UnicodeUTF8)
	<< QApplication::translate("questao", "<=", 0, QApplication::UnicodeUTF8)
	<< QApplication::translate("questao", ">", 0, QApplication::UnicodeUTF8)
	<< QApplication::translate("questao", "<", 0, QApplication::UnicodeUTF8)
	);

	comboVar->clear();
	comboVar->insertItems(0, QStringList()
	<< QString()
	<< QApplication::translate("questao", "E", 0, QApplication::UnicodeUTF8)
	<< QApplication::translate("questao", "OU", 0, QApplication::UnicodeUTF8)
	);

	comboDominio2->clear();
	comboDominio2->insertItems(0, QStringList()
	<< QString()
	<< QApplication::translate("questao", ">=", 0, QApplication::UnicodeUTF8)
	<< QApplication::translate("questao", "<=", 0, QApplication::UnicodeUTF8)
	<< QApplication::translate("questao", ">", 0, QApplication::UnicodeUTF8)
	<< QApplication::translate("questao", "<", 0, QApplication::UnicodeUTF8)
	);

// ------------------------------------------------

	//formLay->addWidget(questao);
}

query::~query(void){


}

bool query::checkedForRemoval(void){

	return button->isChecked();
}

void query::setNum(int num){

	this->setTitle(QApplication::translate("questao", tr("Quest\303\203o %1").arg(num).toStdString().c_str(), 0, QApplication::UnicodeUTF8));
}

QString query::getQuestion(){
	return linePergunta->text();
}

void query::setQuestion(QString s){
	linePergunta->setText(s);
}


